package com.adcc.swingui.demo.toolbar;

import java.awt.Container;

import javax.swing.AbstractButton;
import javax.swing.ImageIcon;
import javax.swing.JComponent;

import com.adcc.swingui.base.DefaultDialog;
import com.adcc.swingui.base.DefaultToolBar;
import com.adcc.swingui.demo.dialog.SaveDialog;
import com.adcc.swingui.factory.SwingDialogFactory;

/**
 * 图片保存
 * 
 * @author charlie
 * 
 */
public class ImgSaveToolBut extends DefaultToolBar {

	private AbstractButton but;

	public ImgSaveToolBut(Container container) {
		super(container);
	}

	@Override
	protected JComponent build() {
		but = createButton(new ImageIcon("res/images/save.png"));
		but.setToolTipText("图片保存");
		return but;
	}

	@Override
	protected void addMouseListener() {
		// 这里填写对应响应事件
		DefaultDialog dia =SwingDialogFactory.create(SaveDialog.class.getName(), true, container);
		dia.init(new Object());
	}

	@Override
	protected void i18n() {
		// TODO Auto-generated method stub

	}

}
